$data modify storage dab:system temp.arrow_item.id set from entity @s Inventory[{Slot:$(index)b}].components."minecraft:custom_data".id
$data modify storage dab:system temp.arrow_item.count set from entity @s Inventory[{Slot:$(index)b}].count
$item replace entity @s hotbar.$(index) with air